<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Ask extends User_Controller {

	public function __construct()
    {
        parent::__construct();
        // Your own constructor code
        $this->smarty->assign("current_class", $this->router->fetch_class());
        $this->smarty->assign("current_method",$this->router->fetch_method());
		$this->uid = $this->user_data['id'];
		if( $this->logged_in==0) {header("Location:/");exit;}
    }

	
	public function my_questions(){
		$this->load->model('User_center_model');
		$homework = $this->User_center_model->get_my_questions($this->user_data['id']);
		$this->smarty->assign("homework", $homework);
		$this->smarty->assign("menu", "homework");
		$this->smarty->display("user/my_questions.html");
	}
	
	public function my_answers(){
		$this->load->model('User_center_model');
		$homework = $this->User_center_model->my_answers($this->user_data['id']);
		$this->smarty->assign("homework", $homework);
		$this->smarty->assign("menu", "homework");
		$this->smarty->display("user/my_answers.html");
		
	}
	
	public function my_question_follow(){
		$this->load->model('User_center_model');
		$homework = $this->User_center_model->my_question_follow($this->user_data['id']);
		$this->smarty->assign("homework", $homework);
		$this->smarty->assign("menu", "homework");
		$this->smarty->display("user/my_question_follow.html");
		
	}

}